# -*- coding: utf-8 -*-
# @Time    : 2018/1/9 10:52
# @Author  : xincheng.zhao
# @File    : fault_interface.py
# @Software: PyCharm
from django.http import HttpResponse
from django.shortcuts import render

from bsfault.models import info


def real_time(request):
    return render(request, 'real_time.html')


'''
远程插入，需要传入事件
'''


def fault_log(request):
    info(fault_events=request.POST.get('event')).save()
    return HttpResponse({'state': 200})
